<!-- 出库记录管理页面 -->
<template>
  <div class="supplierMessage">
    <!-- 搜索分类部分 -->
    <el-card class="searchCard" shadow="never" :body-style="{ padding: '20px' }">
      <div slot="header">
        <span>记录查询</span>
      </div>
      <el-form ref="searchForm" class="searchForm" :model="searchForm" label-width="100px" :inline="false" size="normal">
        <!-- 出库单号填写 -->
        <el-form-item label="出库单号:">
          <el-input v-model="searchForm.warehouseName" style="width:200px" placeholder="出库单号" size="small" clearable />
        </el-form-item>
        <!-- 商品名称填写 -->
        <el-form-item label="商品名称:">
          <el-input v-model="searchForm.warehouseName" style="width:200px" placeholder="商品名称" size="small" clearable />
        </el-form-item>
        <!-- 商品类型选择 -->
        <el-form-item label="商品类型：">
          <el-select v-model="searchForm.readState" style="width:250px" size="medium" placeholder="请选择" @change="change">
            <el-option label="实物" value="0" />
            <el-option label="服务" value="1" />
            <el-option label="全部" value="2" />
          </el-select>
        </el-form-item>
        <!-- 出库方式选择 -->
        <el-form-item label="出库方式：">
          <el-select v-model="searchForm.readState" style="width:250px" size="medium" placeholder="请选择" @change="change">
            <el-option label="全部" value="0" />
            <el-option label="供应商直发" value="1" />
            <el-option label="仓库发货" value="2" />
            <el-option label="自提" value="3" />
            <el-option label="预约-直发" value="4" />
            <el-option label="预约-存量" value="5" />
            <el-option label="出库退货" value="6" />
          </el-select>
        </el-form-item>
        <!-- 销售单号填写 -->
        <el-form-item label="销售单号:">
          <el-input v-model="searchForm.warehouseName" style="width:200px" placeholder="商品名称" size="small" clearable />
        </el-form-item>
        <!-- 出库时间选择 -->
        <el-form-item class="datePicker" label="出库时间:">
          <el-date-picker
            v-model="searchForm.value1"
            type="datetimerange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            size="small"
          />
        </el-form-item>
        <!-- 查询重置按钮 -->
        <el-form-item>
          <el-button type="default" size="small">重置</el-button>
          <el-button type="primary" size="small">查询</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <!-- 仓库列表卡片 -->
    <el-card class="supplierList" shadow="never" :body-style="{ padding: '20px' }">
      <div slot="header">
        <span>出库记录</span>
      </div>
      <template>
        <!-- 仓库列表 -->
        <el-table
          :data="tableData"
          style="width: 100%"
          border
          :header-cell-style="{textAlign: 'center'}"
          :cell-style="{ textAlign: 'center' }"
        >
          <el-table-column
            prop="num"
            label="出库单号"
            width="200"
          />
          <el-table-column
            prop="warehouseName"
            label="商品名称"
            width="200"
          />
          <el-table-column
            prop="staff"
            label="销售单号"
            width="200"
          />
          <el-table-column
            prop="telephone"
            label="出库时间"
          />
          <el-table-column
            prop="contactPlace"
            label="出库数量"
          />
          <el-table-column
            prop="remarks"
            label="出库方式"
          />
          <el-table-column
            prop="remarks"
            label="状态"
          />
          <el-table-column
            prop="remarks"
            label="异常处理"
          >
            <template>
              <el-button type="text" size="medium" @click="exceptionHandling">1</el-button>
            </template>
          </el-table-column>
          <el-table-column
            label="操作"
            width="400"
          >
            <template slot-scope="scope">
              <el-button type="text" size="small" @click="editWarehouse(scope.row)">详情</el-button>
              <el-button type="text" size="small" @click="deleteWarehouse">核销</el-button>
            </template>
          </el-table-column>
        </el-table>
        <div class="block">
          <!-- 出库表格分页器 -->
          <el-pagination
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
          />
        </div>
      </template>
    </el-card>
  </div>
</template>

<script>
export default {
// import引入的组件需要注入到对象中才能使用，
  components: {},
  data() {
    // 这里存放数据
    return {
      editWarehouseForm: { // 编辑虚拟框信息

      },
      showEditWarehouse: false,
      addForm: { // 添加仓库数据
        warehouseName: '',
        staff: '',
        telephone: '',
        contactPlace: '',
        remarks: ''
      },
      dialogVisible: false,
      searchForm: {
        DeliveryOrder: '', // 出库单号
        goodsName: ''// 订单名称
      },
      tableData: [{
        num: 1,
        warehouseName: '服务仓',
        staff: '张三',
        telephone: '17312341234',
        contactPlace: '浙江省杭州市',
        remarks: '17311111111'
      }, {
        num: 1,
        warehouseName: '服务仓',
        staff: '张三',
        telephone: '17312341234',
        contactPlace: '浙江省杭州市',
        remarks: '17311111111'
      }],
      currentPage4: 2 // 当前页数
    }
  },
  // 监听属性 类似于data概念
  computed: {},
  // 监控data中的数据变化
  watch: {},
  // 生命周期 - 创建完成（可以访问当前this实例）
  created() {

  },
  // 生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {

  },
  beforeCreate() {}, // 生命周期 - 创建之前
  beforeMount() {}, // 生命周期 - 挂载之前
  beforeUpdate() {}, // 生命周期 - 更新之前
  updated() {}, // 生命周期 - 更新之后
  beforeDestroy() {}, // 生命周期 - 销毁之前
  destroyed() {}, // 生命周期 - 销毁完成
  activated() {},
  // 方法集合
  methods: {
    exceptionHandling() {
      console.log('异常处理')
    },
    deleteWarehouse() {
      console.log('删除仓库')
    },
    editWarehouse(el) { // 编辑虚拟框信息

    },
    addWarehouse() { // 跳转到添加供应方页面

    },
    handleSizeChange(val) { // 分页器事件每页条数
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) { // 分页器事件当前页
      console.log(`当前页: ${val}`)
    }
  } // 如果页面有keep-alive缓存功能，这个函数会触发
}
</script>
<style scoped lang="scss">
.supplierMessage{
   width: 100%;
   height: 100%;
   overflow: hidden;
   background-color: #f0f2f5;
    .searchCard{
      margin: 30px;
      .searchForm{//搜索表单样式
        display: flex;
        flex-wrap: wrap;
      }
    }
    .supplierList{//供应商列表
      margin: 30px;
    }
    .addWarehouse{
      display: flex;
      justify-content: space-around;
    }
    .block{//分页器样式
      margin-top: 20px;
        padding: 20px;
        display: flex;
        justify-content: center;
      }
}
</style>
